For example, a patent literature 1 has proposed an optical sensor having a semiconductor substrate formed with a plurality of light receiving elements. The optical sensor has a light-shielding portion above the semiconductor substrate. The light-shielding portion has a plurality of light-leading portions correspondingly provided for the light-receiving elements.
The light-leading portions are provided in the light-shielding portion such that the angles of light incident on the light-receiving elements are different from each other. Thus, the respective light-receiving elements have directional characteristics with respect to the incident direction of the light. That is, in the optical sensor, the directional characteristics of light are provided beforehand to have a highest light-receiving intensity in a specified direction.